﻿using System.Web.Mvc;
using System.Web.Routing;

namespace Portal.Web.Areas.Admin
{
    public class AdminAreaRegistration : AreaRegistration
    {
        public override string AreaName
        {
            get
            {
                return "Admin";
            }
        }

        public override void RegisterArea(AreaRegistrationContext context)
        {
            context.MapRoute("Admin", "Admin",
                             new { culture = "zh-cn", controller = "Login", action = "Index" },
                             new { culture = "^[a-zA-Z]{2}(-[a-zA-Z]{2})?$" }, new[] { "Portal.Web.Areas.Admin.Controllers" });
            context.MapRoute("LkAdmin", "lkadmin",
                             new { culture = "zh-cn", controller = "Login", action = "Index" },
                             new { culture = "^[a-zA-Z]{2}(-[a-zA-Z]{2})?$" }, new[] { "Portal.Web.Areas.Admin.Controllers" });


            context.MapRoute(
            "Admin_culture",
            "Admin/{culture}/{controller}/{action}/{id}",
            new { culture = "zh-cn", action = "Index", id = UrlParameter.Optional },
            new { culture = "^[a-zA-Z]{2}(-[a-zA-Z]{2})?$" });
            context.MapRoute(
                "Admin_culture_default",
                "Admin/{controller}/{action}/{culture}/{id}",
                new { culture = "zh-cn", action = "Index", id = UrlParameter.Optional },
                new { culture = "^[a-zA-Z]{2}(-[a-zA-Z]{2})?$" });
            context.MapRoute(
                "Admin_default",
                "Admin/{controller}/{action}/{id}",
                new { action = "Index", id = UrlParameter.Optional }
            );
        }
    }
}
